using hao_Dto.User;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace User.Service
{
    public interface IUserService
    {
        Task<UserDto> GetByIdAsync(Guid id);
        Task<List<UserDto>> GetAllAsync();
        Task AddAsync(UserDto user);
        Task UpdateAsync(UserDto user);
        Task DeleteAsync(Guid id);

        Task<List<RoleDto>> GetUserRolesAsync(Guid userId);
        Task AssignRolesAsync(Guid userId, List<Guid> roleIds);
        Task<UserWithRolesDto> GetUserWithRolesAsync(Guid userId);
    
        // 登录相关方法
        Task<LoginResponseDto> LoginAsync(LoginDto loginDto);
        Task<UserDto> RegisterAsync(RegisterDto registerDto);
        // 管理员创建用户方法
        Task<UserDto> CreateUserAsync(CreateUserDto createUserDto);
        Task<bool> ValidateUserAsync(string userName, string password);
        Task<UserDto> GetUserByUserNameAsync(string userName);
        
        // 新增Controller需要的方法
        Task<UserDto> GetUserByIdAsync(Guid id);
        Task<List<UserDto>> GetAllUsersAsync();
        Task<bool> UpdateUserAsync(Guid id, UpdateUserDto updateUserDto);
        Task<bool> DeleteUserAsync(Guid id);
        Task<bool> ChangePasswordAsync(Guid userId, ChangePasswordDto changePasswordDto);
        Task<LoginResponseDto> RefreshTokenAsync(Guid userId);
        
        // 用户状态管理方法
        Task<bool> EnableUserAsync(Guid userId, string reason = null);
        Task<bool> DisableUserAsync(Guid userId, string reason = null);
        Task<bool> LockUserAsync(Guid userId, string reason = null);
        Task<bool> UnlockUserAsync(Guid userId, string reason = null);
        Task<bool> UpdateUserStatusAsync(Guid userId, UpdateUserStatusDto updateStatusDto);
        
        // 批量操作方法
        Task<bool> BatchEnableUsersAsync(BatchOperationDto batchDto);
        Task<bool> BatchDisableUsersAsync(BatchOperationDto batchDto);
        Task<bool> BatchDeleteUsersAsync(BatchOperationDto batchDto);
        
        // 搜索和筛选方法
        Task<(List<UserDto> Users, int TotalCount)> SearchUsersAsync(UserSearchDto searchDto);
        Task<List<UserDto>> GetUsersByStatusAsync(int status, int pageNumber = 1, int pageSize = 10);
        
        // 管理员重置用户密码方法
        Task<bool> ResetUserPasswordAsync(Guid userId, string newPassword);
    }
}